package com.coffee.core.enums;

public enum InquireOrderStatusEnum {
    WAITING("waiting", "等待反馈")
    ,WAITINGCONFIRM("waitingconfirm", "等待确认")
    ,BUYERGCONFIRM("buyergconfirm", "买方确认")
    ,SELLERCONFIRM("sellerconfirm", "等待付款")
    ,PAY("pay", "开始备货")
    ,WAITDELIVER("waitdeliver", "准备发货")
    ,DELIVER("deliver", "商品发货")
    ,SUCCESS("success", "交易成功")
    ,CANCEL("cancel", "交易关闭")
    ;

    private String code;
    private String name;

    private InquireOrderStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static InquireOrderStatusEnum getByCode(String code) {
        for (InquireOrderStatusEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }

        return WAITING;
    }
}
